using System.Collections.Generic;
namespace WPFExcelReport
{
    public partial class VAMAKT
    {
        public void CREATEAMAKT(Dictionary<string, object> pm)
        {
            dwData = TBMain.NewRow();
            SetUpNewRow(ref dwData);
            dwData["AMTMANDANT"] = app.Mandant;
            dwData["AMTMNRKRS"] = (string)pm["MKRS"];
            dwData["AMTMLFDNR"] = (string)pm["MLFD"];
            dwData["AMTMPOS"] = (string)pm["MPOS"];
            dwData["AMTDAT"] = (string)pm["PDCDATE"];
            dwData["AMTZT"] = (string)pm["PDCTIMES"]+"000";
            dwData["AMTRUN"] ="J";
            dwData["AMTOUT1"] = " ";
            dwData["AMTAUFKRS"] = (string)pm["KRS"];
            dwData["AMTAUFLFD"] = (string)pm["LFD"];
            dwData["AMTAUFPOS"] = (string)pm["POS"];
            dwData["AMTAFOLGE"] = (string)pm["STEP"];
            dwData["AMTBAUMKRS1"] = (string)pm["BKRS"];
            dwData["AMTBAUMLFD1"] = (string)pm["BLFD"];
            SResult = QAMAKT01(dwData);
            if(SResult.Tables[0].Rows.Count>0)
            {
                UAMAKT02(dwData);
            }
            else
            {
                InsertAMAKT(dwData);
            } 
            
        }
        public void UNLOADBEAM(Dictionary<string, object> pm)
        {
            dwData = TBMain.NewRow();
            SetUpNewRow(ref dwData);
            dwData["AMTMANDANT"] = app.Mandant;
            dwData["AMTMNRKRS"] = (string)pm["MKRS"];
            dwData["AMTMLFDNR"] = (string)pm["MLFD"];
            dwData["AMTMPOS"] = (string)pm["MPOS"];
            dwData["AMTDAT"] = 0;
            dwData["AMTZT"] = 0;
            dwData["AMTRUN"] = " ";
            dwData["AMTOUT1"] = "J";
            dwData["AMTAUFKRS"] = "  ";
            dwData["AMTAUFLFD"] = "000000";
            dwData["AMTAUFPOS"] = "000";
            dwData["AMTAFOLGE"] = "000";
            dwData["AMTBAUMKRS1"] = (string)pm["BKRS"];
            dwData["AMTBAUMLFD1"] = (string)pm["BLFD"];
            UAMAKT02(dwData);
        }
    }
}
